<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">
<body>
	<ui:composition template="/template/template.xhtml">
		<ui:define name="title">#{aqarMsgs.Aqarat_customerPayments_PageTitle}</ui:define>
		<ui:define name="manuBar">
			<ui:include src="/controlling/aqarat/aqaratMenu.xhtml" />
		</ui:define>

		<ui:define name="content">
			<p:panel header="#{aqarMsgs.Aqarat_customerPayments_PaymenyDetails}">
				<h:form id="pay_frm">
					<p:messages id="msgs" />
					<p:panel>
						<h:panelGrid columns="3">
							<h:outputText value="#{aqarMsgs.Aqarat_Customer_Name}" />
							<h:outputText value=":" />
							<h:outputText value="#{paymentsBean.customer.name}" />
							
							<h:outputText value="#{aqarMsgs.Aqarat_Customer_CardNo}" />
							<h:outputText value=":" />
							<h:outputText value="#{paymentsBean.customer.cardNo}" />
							
							<h:outputText value="#{aqarMsgs.Aqarat_Customer_Mobile}" />
							<h:outputText value=":" />
							<h:outputText value="#{paymentsBean.customer.mobile}" />

						</h:panelGrid>
					</p:panel>
					<p:panel id="payments_list">
						<p:dataTable var="pay"
							value="#{paymentsBean.paymentResultSetList}" paginator="true"
							paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
							rows="10" rowsPerPageTemplate="5,10,15,20,25">

							<p:column headerText="#{aqarMsgs.Aqarat_Payment_Money}">
								<h:outputText value="#{pay.money}" />
							</p:column>
							<p:column headerText="#{aqarMsgs.Aqarat_Payment_PaymentDate}">
								<h:outputText value="#{pay.paymentDate}" />
							</p:column>
							<p:column headerText="#{aqarMsgs.Aqarat_Payment_Status}">
								<h:outputText value="#{pay.paymentStatus}" />
							</p:column>
							<p:column headerText="#{aqarMsgs.Aqarat_General_Options}">
								<p:commandButton value="#{aqarMsgs.Aqarat_customerPayments_Pay}" update=":pay_frm:display"
									oncomplete="ConfirmPay.show();" style="white-space:nowrap;text-align: center;font-size: smaller;width:auto" 
									rendered="#{pay.paymentStatusId ==8}">
									<f:setPropertyActionListener
										target="#{paymentsBean.selectedPaymentResultSet}"
										value="#{pay}" />
								</p:commandButton>
							</p:column>

						</p:dataTable>
					</p:panel>
					<p:confirmDialog widgetVar="ConfirmPay" message="#{aqarMsgs.Aqarat_customerPayments_ConfirmDialogHeader}">
						<h:panelGroup id="display">
							<p:commandButton value="#{aqarMsgs.Aqarat_General_Yes}"
								actionListener="#{paymentsBean.payApayment}"
								onstart="waiteDialog.show();" 
								oncomplete="waiteDialog.hide(); ConfirmPay.hide();" update="payments_list"/>
							<p:commandButton value="#{aqarMsgs.Aqarat_General_No}" onclick="ConfirmPay.hide();" />
						</h:panelGroup>
					</p:confirmDialog>
				</h:form>
			</p:panel>
		</ui:define>
	</ui:composition>
</body>
</html>
